package com.letv.business.flow.PlayFlowState;

import com.ledim.app.LeDimApplication;
import com.letv.business.flow.PlayFlowEvents.FetchMetaEvent;
import com.letv.business.flow.PlayFlowModule.NetworkManager;
import com.letv.core.utils.LogInfo;


import android.app.Application;

import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

import javax.inject.Inject;

/**
 * Created by jipengfei on 2016/10/31.
 */
public class PlayIdleState extends BasePlayState {

    @Inject
    NetworkManager networkManager;



    @Override
    protected void injectDependencies() {
        LeDimApplication.getComponentInstance().inject(this);
    }

    @Override
    public void onStateApplied() {
        super.onStateApplied();
        mPlayFlow = getProvider().providPlayFlow();
        LogInfo.log("sguotao", "进入idle State");

    }

    @Override
    public void onStateLeft() {
        super.onStateLeft();

    }
//    @Subscribe
//    public void onRecordCheckEvent(RecordCheckEvent recordCheckEvent) {
//
//        fireEvent(PlayFlowEvents.Play_RecordCheck);
//
//    }


    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onFetchMetaEvent(FetchMetaEvent fetchMetaEvent) {

        LogInfo.log("sguotao", "执行onFetchMetaEvent:");
        networkManager.requestVF(getProvider().providPlayFlow());
        fireEvent(PlayFlowEvents.Play_FetchMeta);
    }

}
